package com.gxuwz.stats.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxuwz.stats.entity.AcademicWorkSum;
import com.gxuwz.stats.entity.ResearchProjectSum;
import com.gxuwz.stats.mapper.AcademicWorkSumMapper;
import com.gxuwz.stats.service.AcademicWorkSumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AcademicWorkSumServiceImpl extends ServiceImpl<AcademicWorkSumMapper, AcademicWorkSum> implements AcademicWorkSumService {

    @Autowired
    private AcademicWorkSumMapper academicWorkSumMapper;

    @Override
    public AcademicWorkSum getByUserId(int userId) {
        QueryWrapper<AcademicWorkSum> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id", userId);
        return academicWorkSumMapper.selectOne(queryWrapper);
    }
}
